A Content Addressable Memory (CAM) is a memory unit that is used to compare an input data word to a number of stored data words. For each stored data word that matches the input data word, a match signal is asserted. If none of the stored data words matches the input data word, a read miss occurs and no match signal is asserted.
One example of a CAM application is a translation buffer that is used in a virtual memory system, where the input data word is a virtual address. If a match is found for the virtual address, the resulting match signal is used to select a corresponding physical address from an associated memory unit. If a read miss occurs, the virtual address is written to a CAM entry determined by a replacement rule, and the corresponding physical address is written to the associated memory unit. CAMs are also widely used in cache memory systems including, for example, fully associative caches.
As in the virtual memory system described above, the input data word is typically written to the CAM subsequent to a read miss. However, as conventionally implemented, the writing step is not automatic. External control logic is required to sense the read miss and generate a CAM write cycle in which the input data word is written to the CAM. Normally, this step requires one or more clock cycles after the read miss occurs. Thus, conventional approaches waste one or more clock cycles in updating the CAM with the input data word, which can have a cumulative effect over time.
Accordingly, what is needed is a CAM in which the input data word is automatically written responsive to a read miss without externally coupled control logic. What is also needed is a CAM in which the input data word is automatically written to one or more CAM entries in the same clock cycle as the comparison operation, using an internally-timed write operation.